var http=require('http');
var url=require('url');
var router=require('./router');

function start(handle){
	function onRequest(request,response){
		var pathname=url.parse(request.url).pathname;
		router.route(handle,pathname,request,response);
	}

	http.createServer(onRequest).listen(8888);
	console.log('运行在8888端口');
}

exports.start=start;